package controle;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import visao.TelaInicial;
import visao.curso.interfaceCurso;
import visao.turma.interfaceTurma;

public class AcoesTelaIni implements ActionListener {
	private TelaInicial ti;
	
	public AcoesTelaIni(TelaInicial ti){
		this.ti = ti;
	}
	public void actionPerformed(ActionEvent evt) {
		if(evt.getSource() == ti.getBtnSair() || evt.getSource() == ti.getMntmSair()){
			int opc = JOptionPane.showConfirmDialog(null, "Deseja realmente sair?", null, JOptionPane.YES_NO_OPTION);
			if(opc == 0){
				ti.dispose();
				System.exit(0);
			}
		}
		if(evt.getSource() == ti.getBtnContCurso()){
			new interfaceCurso().setVisible(true);
		}
		if(evt.getSource() == ti.getBtnContTurma()){
			new interfaceTurma().setVisible(true);
		}
	}

}
